Skip to main content

Transaction Upserted Event

Apart from Custom Events that could be integrated within Insight Factory System there is a defined, built-in Transaction Upserted event, informing about transaction being inserted or updated. When the Meniga Services Transaction Integration event occurs, it is being transformed by External Events Consumer to the Transaction Upserted event. Then the transformed even is sent to Triggering Engine, where evaluation process of corresponding active Insight Definitions takes place.

    public record TransactionsUpsertedEvent 
{
public IEnumerable<Transaction> UpsertedTransactions { get; init; }
public string ExternalMessageId { get; init; }
public UserIdentity User { get; init; }
}
PropertyDescription
UpsertedTransactionsCollection of updated or inserted transactions.
ExternalMessageIdIdentifier of the message passed to the External Events Consumer component.
UserDescribes the identity of the user transactions are made for.

UserIdentity schema

    public record UserIdentity
{
public long Id { get; init; }
public string Identifier { get; init; }
public string Tenant { get; init; }
public string ShardingKey { get; init; }
}
PropertyDescription
IdUnique numeric identifier of the user (used internally).
IdentifierUnique text identifier of the user.
TenantTenant which a given user is assigned to.
ShardingKeyValue indicating which database stores information about a given user.

Transaction schema

   public record Transaction
{
public long Id { get; init; }
public decimal Amount { get; init; }
public decimal SplitRatio { get; init; }
public decimal? BookedAmount { get; init; }
public decimal? AmountInCurrency { get; init; }
public string? Currency { get; init; }
public DateTime TransactionDate { get; init; }
public DateTime? BookingDate { get; init; }
public DateTime? ValueDate { get; init; }
public DateTime? ExecutionDate { get; init; }
public DateTime BudgetDate { get; init; }
public DateTime InsertedDate { get; init; }
public DateTime? ModifiedDate { get; init; }
public string Text { get; init; }
public string OriginalText { get; init; }
public string? CountryCode { get; init; }
public string? Mcc { get; init; }
public bool? IsMerchant { get; init; }
public bool? IsUncleared { get; init; }
public bool? IsOwnAccountTransfer { get; init; }
public bool IsRead { get; init; }
public long CategoryId { get; init; }
public double CategoryAccuracy { get; init; }
public Category[] DetectedCategories { get; init; }
public Account Account { get; init; }
public Counterparty? CounterParty { get; init; }
public IReadOnlyDictionary<string, string>? CustomData { get; init; }
public IReadOnlyDictionary<string, string>? NormalizedFields { get; init; }
public Merchant? Merchant { get; init; }
public User User { get; init; }
public int Version { get; init; }
}
PropertyDescription
IdUnique identifier of the transaction.
AmountThe original amount of the transaction in user currency.
SplitRatioTells from 0.0 to 1.0 how the Amount, BookedAmount and AmountInCurrency have been split between categories. Value is 1.0 if the transaction has not been split.
BookedAmountThe original amount of the transaction in the Account.Currency.
AmountInCurrencyThe original amount of the transaction in the transaction's Currency.
CurrencyISO 4217 Alpha 3 currency code of the AmountInCurrency.
TransactionDateThe date of the transaction.
BookingDateThe booking date of the transaction.
ValueDateThe value date of the transaction.
ExecutionDateThe execution date of the transaction.
BudgetDateThe date of the transaction used in most business modules, e.g. to calculate the budget or to sum up for reports.
InsertedDateThe date when the transaction was stored in the Meniga Database.
ModifiedDateThe date when the transaction was modified in the Meniga Database.
TextThe enriched text of the transaction.
OriginalTextThe original text of the transaction.
CountryCodeThe ISO 3166-1 alpha-2 code for the country this transaction originates from.
MccThe ISO 18245 Merchant Category Code.
IsMerchanttrue if the transaction is linked to a merchant, false if we know it is not linked to a merchant and null if there is no information. Either set by the external data source or set to true through the Transaction Enrichment Process.
IsUnclearedtrue if the transaction has not been cleared in the banking systems, e.g. if it is a reservation. false if the transaction has been cleared. null if there is no information.
IsOwnAccountTransfertrue if it is known that the transaction was made between two accounts that the User owns, false if it is know it was not, null it it is unknown.
IsReadtrue if the user has seen and reviewed the transaction.
CategoryIdThe id of the categorization assigned in the enrichment process. The top scoring category from the DetectedCategories is assigned. The category can also be changed by the user.
CategoryAccuracyTells from 0.0 to 1.0 how accurate the categorization of the transaction is.
DetectedCategoriesTells what categories were detected in the enrichment process and their scores. Schema of Category type could be found here.
AccountAccount that transaction is inserted to or updated. Schema of Account type could be found here.
CounterPartyInformation on the counter party of the transaction. Schema of CounterParty type could be found here.
CustomDataList of custom data that is not part of the top-level transaction object. The available property names depend on the external data source. This object can have N many different property names.
NormalizedFieldsList of custom data captured by the Transaction Normalization Rules that run as part of the enrichment process. The available property names depend on what the Normalization Rules output as normalized fields. The total length of the data contained in the normalized fields key + values is 2000 characters. This object can have N many different property names.
MerchantThe merchant that has been linked to the transaction through the enrichment process. Schema of Merchant type could be found here.
UserInformation about the user who owns the data in the message. Schema of User type could be found here.
VersionThe change history version of the current transaction that is incremented for each operation performed on the transaction.

Account schema

  public record Account
{
public long Id { get; init; }
public string ExternalIdentifier { get; init; }
public long AccountTypeId { get; init; }
public string Name { get; init; }
public string Currency { get; init; }
public decimal Balance { get; init; }
public Balance[] Balances { get; init; }
public decimal? Limit { get; init; }
public bool IsDisabled { get; init; }

public int? RealmId { get; init; }
public long? RealmUserId { get; init; }
public string? RealmUserIdentifier { get; init; }
public string? RealmIdentifier { get; init; }
public int Version { get; init; }
}
PropertyDescription
IdThe identifier of the account. Only unique per User.Id.
ExternalIdentifierA unique identifier from the external data source of the account.
AccountTypeIdThe Meniga Account Type id of the account.
NameThe name of the account.
CurrencyThe currency code the account. ISO 4217 Alpha 3 currency code.
BalanceThe balance of the account after the transaction was imported.
BalancesThe different types of balances of the account after the transaction was imported. Schema of Balance type could be found here.
LimitThe limit of the account.
IsDisabledtrue if the this account should be excluded from all calculations.
RealmIdA unique id of the external data source that realm users and their data can be loaded from. If the RealmUserId field has a value then this field is required, else optional.
RealmUserIdAn identifier of the Realm User in the Meniga Database, only unique per User.Id.
RealmUserIdentifierThe identifier of the user within the external data source, only unique within the given RealmIdentifier. If the RealmUserId field has a value then this field is required, else optional.
RealmIdentifierA unique identifier of the external data source that realm users and their data can be loaded from. If the RealmUserId field has a value then this field is required, else optional.
VersionThe change history version of the current account that is incremented for each operation performed on the account or the transactions that belong to the account.

Balance schema

    public record Balance
{
public decimal Amount { get; init; }
public DateTime Date { get; init; }
public string Type { get; init; }
public string Currency { get; init; }
}
PropertyDescription
AmountThe balance of the account after the transaction was imported.
DateThe date of the balance.
TypeThe type of the balance according to ISO20022 standard for defining balance types, possible values ['closing-booked','expected','authorised','opening-booked','interim-available','forward-available'].
CurrencyThe currency of the Amount. ISO 4217 Alpha 3 currency code.

Category schema

   public record Category
{
public int Id { get; init; }
public double Score { get; init; }
}
PropertyDescription
IdThe id of the category.
ScoreTells from 0.0 to 1.0 how relevant this category is to the transaction.

Counterparty schema

    public record Counterparty
{
public string? Name { get; init; }
public string? AccountIdentifier { get; init; }
public string? IdentifierType { get; init; }
}
PropertyDescription
NameThe name of the counter party.
AccountIdentifierA unique identifier of the account in the external source system.
IdentifierTypeThe type of the counter party account identifier. Values can be: "iban", "bban", "pan", "maskedPan", "msisdn", "custom".

Merchant schema

    public record Merchant
{
public long Id { get; init; }
public string? Name { get; init; }
public MerchantParent? Parent { get; init; }
}
PropertyDescription
IdThe id of the merchant. Unique per setup of Merchant Mapping Service.
NameThe name of the merchant.
ParentThe merchant that is the parent merchant of the merchant.Schema of MerchantParent type could be found here.

Merchant parent schema

    public record MerchantParent
{
public long Id { get; init; }
public string? Name { get; init; }
}
PropertyDescription
IdThe id of the merchant. Unique per setup of Merchant Mapping Service.
NameThe name of the merchant.

User schema

    public record User
{

public long Id { get; init; }

public string Identifier { get; init; }

public string Currency { get; init; }

public string ShardingKey { get; init; }

public string Tenant { get; init; }
}
PropertyDescription
CurrencyCurrency assigned to user.
Id/Identifier/ShardingKey/TenantProperties are the same as in UserIdentity.